#ifndef TIMESTAMP_H
#define TIMESTAMP_H

#ifdef NDEBUG
#define timestamp(...)
#else
#ifdef __func__
#define timestamp(...) timestamp0(__FILE__, __LINE__, __func__, ##__VA_ARGS__)
#elif defined(__FUNCTION__)
#define timestamp(...) timestamp0(__FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__)
#else
#define timestamp(...) timestamp0(__FILE__, __LINE__, "", ##__VA_ARGS__)
#endif
#endif /* NDEBUG */

int64 timestamp0(const char* file, int line, const char* func, const char* label);

#endif /* TIMESTAMP_H */
